package com.shuqi.database.dao;

import java.sql.SQLException;
import java.util.concurrent.Callable;

import com.j256.ormlite.dao.RuntimeExceptionDao;
import com.j256.ormlite.misc.TransactionManager;


public class OrmBaseDao {

    protected boolean isDaoEnable(RuntimeExceptionDao<? extends OrmBaseModel, Integer> dao) {
        return dao != null;
    }

    protected Object openTransactionManager(OrmBaseDatabaseHelper helper, Callable<?> callble) throws SQLException {
        return TransactionManager.callInTransaction(helper.getConnectionSource(), callble);
    }
}
